/*
JETware Hands-free Extension provides additional features for Windows Mobile HFP support.
Copyright (C) 2004-2009 Jim Thatcher

This program is free software; you can redistribute it and/or modify it under the terms of the 
GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; 
if not, write to the Free Software Foundation, Inc., 
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Defines structures for Obex packet headers

#define OBEX_MAX_BUFFER		1024

#pragma pack(1)
typedef struct tagObexBasicReqest
{
	BYTE cmd;
	WORD length;
} OBEX_BASIC_REQUEST;

typedef struct tagStreamHeader
{
	BYTE type;
	WORD length;
	BYTE data[1];
} OBEX_STREAM_HEADER;

typedef struct tagTargetHeader
{
	BYTE type;
	WORD length;
	BYTE data[9]; // TODO: Do we need to allow targets other than "IRMC-SYNC"
} OBEX_TARGET_HEADER;

typedef struct tagDwordHeader
{
	BYTE type;
	DWORD value;
} OBEX_DWORD_HEADER;

typedef struct tagBasicConnectRequest
{
	BYTE cmd;
	WORD length;
	BYTE version;
	BYTE flags;
	WORD MaxPacketLen;
} OBEX_BASIC_CONNECT_REQUEST;

typedef struct tagConnectRequest
{
	BYTE cmd;
	WORD length;
	BYTE version;
	BYTE flags;
	WORD MaxPacketLen;
	OBEX_STREAM_HEADER target;
} OBEX_CONNECT_REQUEST;

typedef struct tagBasicResponse
{
	BYTE response;
	WORD length;
} OBEX_BASIC_RESPONSE;

typedef struct tagConnectResponse
{
	BYTE response;
	WORD length;
	BYTE version;
	BYTE flags;
	WORD MaxPacketLen;
	OBEX_DWORD_HEADER connid;
	OBEX_TARGET_HEADER who;
} OBEX_CONNECT_RESPONSE;

typedef struct tagPutRequest
{
	BYTE cmd;
	WORD length;
	OBEX_STREAM_HEADER body;
} OBEX_PUT_REQUEST;
